Skip to content

fix: redirect client packages during prerender#200

Open
V3RON wants to merge 2 commits into
mainfrom
fix/prerender-client-import-aliases
Open

fix: redirect client packages during prerender#200
V3RON wants to merge 2 commits into
mainfrom
fix/prerender-client-import-aliases

Conversation

@V3RON

@V3RON V3RON commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

What is this?

This PR makes build-time prerendering tolerant of widget initial-state modules that import @use-voltra/ios-client or @use-voltra/android-client by mistake. Those imports now redirect to @use-voltra/ios and @use-voltra/android during prerendering, with a warning so the mix-up is still visible.

How does it work?

packages/expo-plugin/src/utils/prerender.ts now intercepts bare module imports in the VM-based prerender path. When it sees one of the client package names, it logs a warning once per prerender run and resolves the matching platform package through the project root. A regression test covers both redirect paths with a temporary project fixture.

Why is this useful?

  • Prevents prerender from breaking on a common package-name mix-up.
  • Keeps the fix local to build-time widget evaluation, so runtime app code is unaffected.
  • Gives a clear warning so the mistake is visible without failing the build.

V3RON added 2 commits June 17, 2026 16:58
Warn once and reroute ios-client/android-client imports to their platform packages when build-time prerendering widget initial states.
Keep the prerender fixture outside repo tree so it never appears in git status during local verification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant